package com.lottery.ruok.lottrey.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.lottery.ruok.lottrey.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import ui.LineRecordView;
import ui.NavigateBar;
/*
* 提现详情
* */
public class ChargeDetailActivity extends BaseActivity {

    @BindView(R.id.navigateBar)
    NavigateBar navigateBar;
    @BindView(R.id.deal_no)
    LineRecordView dealNo;
    @BindView(R.id.deal_time)
    LineRecordView dealTime;
    @BindView(R.id.deal_mode)
    LineRecordView dealMode;
    @BindView(R.id.deal_condition)
    LineRecordView dealCondition;
    @BindView(R.id.deal_money)
    LineRecordView dealMoney;
    @BindView(R.id.deal_discounts)
    LineRecordView dealDiscounts;
    @BindView(R.id.other_discounts)
    LineRecordView other_discounts;

    @BindView(R.id.remark)
    TextView remark;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_charge_detail);
        ButterKnife.bind(this);

        init();
    }

    private void init() {
        if(getIntent().getIntExtra("type", 0) == 2){
            navigateBar.setCenterTitle("提现详情");
            other_discounts.setVisibility(View.GONE);
        }
        dealNo.setRightTitle(getIntent().getStringExtra("deal_no"));
        dealTime.setRightTitle(getIntent().getStringExtra("deal_time"));
        dealMode.setRightTitle(getIntent().getStringExtra("deal_model"));
        String color;
        switch (getIntent().getStringExtra("condition")) {
            case "待审核":
            case "待支付":
                color = "#d8971d";
                break;
            case "已审核":
                color = "#989898";
                break;
            case "拒绝":
                color = "#f45300";
                break;
            case "异常":
                color = "#661dac";
                break;
            default:
                color = "#3f3f3f";
                break;
        }
        dealCondition.setRightTitleColor(color);
        dealCondition.setRightTitle(getIntent().getStringExtra("condition"));
        dealMoney.setRightTitle(getIntent().getStringExtra("money"));
        dealDiscounts.setRightTitle(getIntent().getStringExtra("discounts"));
        other_discounts.setRightTitle(getIntent().getStringExtra("offer2"));
        if(getIntent().getStringExtra("remark") != null) {
            remark.setText(getIntent().getStringExtra("remark"));
        }

        dealNo.setLeftTitleColor("#989898");
        dealNo.setRightTitleColor("#5b5b5b");
        dealTime.setLeftTitleColor("#989898");
        dealTime.setRightTitleColor("#5b5b5b");
        dealMode.setLeftTitleColor("#989898");
        dealMode.setRightTitleColor("#5b5b5b");
        dealCondition.setLeftTitleColor("#989898");
        dealMoney.setLeftTitleColor("#989898");
        dealMoney.setRightTitleColor("#5b5b5b");
        dealDiscounts.setLeftTitleColor("#989898");
        dealDiscounts.setRightTitleColor("#5b5b5b");
        other_discounts.setLeftTitleColor("#989898");
        other_discounts.setRightTitleColor("#5b5b5b");
    }
}
